package com.aistar.service.impl;

import com.aistar.mapper.SeckillMapper;
import com.aistar.pojo.Seckill;
import com.aistar.service.SecKillService;
import com.aistar.util.ServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SecKillServiceImpl implements SecKillService {
    @Autowired
    SeckillMapper mapper;
    @Override
    public ServerResponse getById(Integer id) {
          Seckill seckill= mapper.selectByPrimaryKey(id);
        return ServerResponse.getDataSuccess(seckill);
    }

    @Override
    public ServerResponse secRush(Seckill seckill) {
        mapper.updateByPrimaryKeySelective(seckill);
        return ServerResponse.updateSuccess();
    }


}
